<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        千米: <input type="number" v-model="km">
        米:   <input type="number" v-model="meter">
       
    </div>
</body>
<script>
    const vm=new Vue({
    el:'#app',
    data:{
        km:0,
        meter:0
    },
    watch: {
        km:function(val){
            this.meter=val*1000;
        },
        meter:function(val){
            this.km=val/1000;
        }
    }
})
</script>
</html>